Computer programs that operate in a windowing environment commonly use dialog windows to present information and receive input from a user. One example of a popular windowing environment is the Windows.RTM.95 operating system, by Microsoft Corporation of Redmond, Wash.. Programs that execute on the Windows.RTM.95 operating system commonly include dialog windows containing one or more controls. Examples of these controls are push buttons, radio buttons, check boxes, and edit boxes. Static controls display or organize information, but do not receive user input. A label box control, which is made up of a rectangular border and a text label, is one example of a static control.
In order to create a dialog window, programmers specify the position and dimensions of each control within the window. In some operating systems, such as the Windows.RTM.95 operating system, a programmer creates a set of resource data that specifies the precise position and dimensions of each control. The coordinates and dimensions can be specified either in pixels or dialog units. The value of a dialog unit is operating system dependent. For example, in Windows 95, a dialog unit is a distance relative to the size of one text character.
The process of laying out a dialog window by specifying the coordinates and dimensions of each control can require considerable effort. In order to change a dialog window, a program developer may need to recalculate the coordinates of each control. When a dialog window is localized for use in other countries by translating it into different languages, additional work is required to reposition the controls of the dialog window for each version.
In addition, during execution of a computer program, the contents of a dialog window may change between multiple invocations of the window. When the control coordinates are specified prior to execution of the program, the layout of the dialog window does not change, even if the window's contents change.
It is desirable to have a mechanism that allows a program developer to specify the relative positions of the controls within the dialog window, without specifying precise coordinates or dimensions of each control. Preferably, such a mechanism will automatically calculate the coordinates of each control and position the controls correctly at the time the dialog window is displayed during execution of the program. The present invention is directed to providing such a mechanism.